<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>抽奖场次管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.success(data.msg);
					jp.go("${ctx}/sessions/sessions");
				}else{
				    jp.error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});

		});
	</script>
</head>
<body>
<div class="wrapper wrapper-content">				
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title"> 
				<a class="panelButton" href="${ctx}/sessions/sessions"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="sessions" action="${ctx}/sessions/sessions/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次名称：</label>
					<div class="col-sm-10">
						<form:input path="sessionsName" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次图片：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="sessionsPic"  value="${sessions.sessionsPic}" type="file" uploadPath="/sessions/sessions"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次价格：</label>
					<div class="col-sm-10">
						<form:input path="sessionsPrice" htmlEscape="false"    class="form-control required isFloatGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">原价：</label>
					<div class="col-sm-10">
						<form:input path="originalPrice" htmlEscape="false"    class="form-control required isFloatGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次开始时间：</label>
					<div class="col-sm-10">
						<form:input path="sessionsBegin" htmlEscape="false"    class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次结束时间：</label>
					<div class="col-sm-10">
						<form:input path="sessionsEnd" htmlEscape="false"    class="form-control required"/>
					</div>
				</div>
				<p style="color: red;margin-left: 20px">注：请用英文输入法输入开始结束时间，例：09:00 或 14:00</p>
				<div class="form-group">
					<label class="col-sm-2 control-label">场次收益说明：</label>
					<div class="col-sm-10">
						<form:input path="sessionsProfit" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">拼团所需人数：</label>
					<div class="col-sm-10">
						<form:input path="sessionsMember" htmlEscape="false"    class="form-control required isIntGtZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">返还参与金额百分比：</label>
					<div class="col-sm-10">
						<form:input path="sessionsBack" htmlEscape="false"    class="form-control required isFloatGteZero"/>
					</div>
				</div>
				<%--<div class="form-group">--%>
					<%--<label class="col-sm-2 control-label">幸运星收益金额：</label>--%>
					<%--<div class="col-sm-10">--%>
						<%--<form:input path="starProfit" htmlEscape="false"    class="form-control  isFloatGteZero"/>--%>
					<%--</div>--%>
				<%--</div>--%>
				<div class="form-group">
					<label class="col-sm-2 control-label">中奖发放积分：</label>
					<div class="col-sm-10">
						<form:input path="bonusPoints" htmlEscape="false"    class="form-control required isFloatGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注：</label>
					<div class="col-sm-10">
						<form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
					</div>
				</div>



		<c:if test="${mode == 'add' || mode=='edit'}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>				
	</div>
	</div>
</div>
</div>
</body>
</html>